package cn.org.xiaoweiba.graduationdesign.bookmall.controller;

import cn.org.xiaoweiba.graduationdesign.bookmall.dto.result.BaseResponseResult;
import cn.org.xiaoweiba.graduationdesign.bookmall.service.RSAService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * RSA 相关的控制器
 */
@RestController
@RequestMapping("/rsa")
@Tag(name = "RSA", description = "和 RSA 相关的控制器")
public class RSAController {

    @Autowired
    private RSAService rsaService;

    /**
     * 获取通用的 RSA 公钥
     *
     * @return 通用的 RSA 公钥
     */
    @GetMapping("/common/public")
    @Operation(summary = "获取通用的 RSA 公钥")
    public BaseResponseResult<?> getRSACommonPublicKey() {
        return rsaService.getRSACommonPublicKey();
    }

}
